package com.ym.medical.domain.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ym.common.constant.BaseEntity;
import com.ym.common.constant.UserDetails;
import com.ym.common.enums.LoginMethodEnum;
import com.ym.common.enums.UserUserTypeEnum;
import com.ym.medical.enums.CounsellingRoomCourTypeEnum;
import com.ym.medical.enums.DoctorDetailsDoctTypeEnum;
import com.ym.medical.enums.DoctorJobTitle;
import com.ym.medical.enums.HospitalDeptTypeEnum;
import com.ym.medical.enums.UserCardTypeEnum;
import com.ym.medical.enums.UserCertStateEnum;
import com.ym.medical.enums.UserSexEnum;
import com.ym.medical.enums.UserUserStateEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * 医生视图对象 user_doctor_view
 *
 * @author ym
 * @date 2020-08-18
 */
@ApiModel("医生视图-实体")
@Table(name = "user_doctor_view")
public class UserDoctorViewEntity extends BaseEntity implements UserDetails {

	private static final long serialVersionUID = 1L;

	/**
	 * 签名ID
	 */
	@ApiModelProperty("签名ID")
	private Long signId;

	/**
	 * 用户昵称
	 */
	@ApiModelProperty("用户昵称")
	private String nickName;

	/**
	 * 真实姓名
	 */
	@ApiModelProperty("真实姓名")
	private String realName;

	/**
	 * 手机号
	 */
	@ApiModelProperty("手机号")
	private String phoneNo;

	/**
	 * 登录密码
	 */
	@ApiModelProperty("登录密码")
	private String userPwd;

	/**
	 * 01 未知  02 男 03 女 04 保密
	 */
	@ApiModelProperty("01 未知  02 男 03 女 04 保密")
	@JsonSerialize(converter = UserSexEnum.Covert.class)
	private String sex;

	/**
	 * 二维码
	 */
	@ApiModelProperty("二维码")
	private String qrCode;

	/**
	 * 联系地址
	 */
	@ApiModelProperty("联系地址")
	private String contactAddr;

	/**
	 * 身份证	1 港澳台通行证	10部队干部离休证	11工商执照	12单位证明（含公章）	13驾驶证	14学生证	2教师证	3户口本/居住证	4老人证	5组织机构代码证	6军官证	7护照	8虚拟证件	9
	 */
	@ApiModelProperty("身份证	1 港澳台通行证	10部队干部离休证	11工商执照	12单位证明（含公章）	13驾驶证	14学生证	2教师证	3户口本/居住证	4老人证	5组织机构代码证	6军官证	7护照	8虚拟证件	9")
	@JsonSerialize(converter = UserCardTypeEnum.Covert.class)
	private String cardType;

	/**
	 * 证件 号码
	 */
	@ApiModelProperty("证件 号码")
	private String cardNo;

	/**
	 * 生日
	 */
	@ApiModelProperty("生日")
	private Date birthday;

	/**
	 * 邮箱
	 */
	@ApiModelProperty("邮箱")
	private String email;

	/**
	 * 账号类型
	 */
	@ApiModelProperty("账号类型")
	@JsonSerialize(converter = UserUserTypeEnum.Covert.class)
	private String userTypeName;

	/**
	 * 用户 状态
	 */
	@ApiModelProperty("用户 状态")
	@JsonSerialize(converter = UserUserStateEnum.Covert.class)
	private String userState;

	/**
	 * 认证状态
	 */
	@ApiModelProperty("认证状态")
	@JsonSerialize(converter = UserCertStateEnum.Covert.class)
	private String certState;

	/**
	 * 头像地址
	 */
	@ApiModelProperty("头像地址")
	private String headUrl;

	/**
	 * 上次登录时间
	 */
	@ApiModelProperty("上次登录时间")
	private Date lastLoginTime;

	/**
	 * 登录设备
	 */
	@ApiModelProperty("登录设备")
	private String loginDevice;

	/**
	 * 登录IP
	 */
	@ApiModelProperty("登录IP")
	private String loginIp;

	/**
	 * 盐值
	 */
	@ApiModelProperty("盐值")
	private String salt;

	/**
	 * 创建人
	 */
	@ApiModelProperty("创建人")
	private Long creater;

	/**
	 * 创建时间
	 */
	@ApiModelProperty("创建时间")
	private Date createTime;

	/**
	 * 修改人
	 */
	@ApiModelProperty("修改人")
	private Long modifier;

	/**
	 * 修改时间
	 */
	@ApiModelProperty("修改时间")
	private Date modifyTime;

	/**
	 * 医生主键
	 */
	@ApiModelProperty("医生主键")
	private Integer doctId;

	/**
	 * 全/专科
	 */
	@ApiModelProperty("全/专科")
	@JsonSerialize(converter = CounsellingRoomCourTypeEnum.Covert.class)
	private String doctCategory;

	/**
	 * 医生编码
	 */
	@ApiModelProperty("医生编码")
	private String doctCode;

	/**
	 * 职称
	 */
	@ApiModelProperty("职称")
	@JsonSerialize(converter = DoctorJobTitle.Covert.class)
	private String jobTitle;

	/**
	 * 资质认证状态
	 */
	@ApiModelProperty("资质认证状态")
	@JsonSerialize(converter = UserCertStateEnum.Covert.class)
	private String qualificationStatus;

	/**
	 * 资质认证时间
	 */
	@ApiModelProperty("资质认证时间")
	private Date qualificationTime;

	/**
	 * 医学教育背景
	 */
	@ApiModelProperty("医学教育背景")
	private String eduBack;

	/**
	 * 学术研究成果/获奖
	 */
	@ApiModelProperty("学术研究成果/获奖")
	private String achiAward;

	/**
	 * 医生寄语
	 */
	@ApiModelProperty("医生寄语")
	private String doctMessage;

	/**
	 * 医院编码
	 */
	@ApiModelProperty("医院编码")
	private String hospitalCode;

	/**
	 * 从业时间
	 */
	@ApiModelProperty("从业时间")
	private Date workTime;

	/**
	 * 标准科室编码
	 */
	@ApiModelProperty("标准科室编码")
	private String deptCode;

	/**
	 * 医生类别 A/B/C/D/E
	 */
	@ApiModelProperty("医生类别 A/B/C/D/E")
	@JsonSerialize(converter = DoctorDetailsDoctTypeEnum.Covert.class)
	private String doctType;

	/**
	 * 科室名称
	 */
	@ApiModelProperty("科室名称")
	private String deptName;

	/**
	 * 科室编码
	 */
	@ApiModelProperty("科室编码")
	private String deptCodeHos;

	/**
	 * 科室名称
	 */
	@ApiModelProperty("科室名称")
	private String deptNameHos;

	/**
	 * 云信账号
	 */
	@ApiModelProperty("云信账号")
	private String accid;

	/**
	 * token
	 */
	@ApiModelProperty("token")
	private String token;

	/**
	 * 医院编码
	 */
	@ApiModelProperty("医院编码")
	private String hosCode;

	/**
	 * 医院名称
	 */
	@ApiModelProperty("医院名称")
	private String hosName;

	/**
	 * 医院等级
	 */
	@ApiModelProperty("医院等级")
	private String hosLevel;

	/**
	 * 省
	 */
	@ApiModelProperty("省")
	private String prov;

	/**
	 * 市
	 */
	@ApiModelProperty("市")
	private String city;

	/**
	 * 区/县
	 */
	@ApiModelProperty("区/县")
	private String area;

	/**
	 * 医院经度
	 */
	@ApiModelProperty("医院经度")
	private String hosLongitude;

	/**
	 * 医院纬度
	 */
	@ApiModelProperty("医院纬度")
	private String hosLatitude;

	/**
	 * 科室类型
	 */
	@ApiModelProperty("科室类型")
	@JsonSerialize(converter = HospitalDeptTypeEnum.Covert.class)
	private String deptType;

	@ApiModelProperty("appKey")
	@JsonIgnore
	private String appKey;

	@ApiModelProperty("appSecret")
	@JsonIgnore
	private String appSecret;

	@ApiModelProperty("登录方式")
	@JsonIgnore
	@Transient
	private LoginMethodEnum loginMethod;

	@Override
	public String getAccount() {
		return this.phoneNo;
	}

	@Override
	public String getUsername() {
		return this.realName == null ? this.nickName : this.realName;
	}

	@Override
	@JsonIgnore
	public String getPassword() {
		return this.userPwd;
	}

	@Override
	public String state() {
		return this.userState;
	}

	@Override
	public String getAppKey() {
		return this.appKey;
	}

	@Override
	public String getAppSecret() {
		return this.appSecret;
	}

	@Override
	public UserUserTypeEnum getUserTypeEnum() {
		return UserUserTypeEnum.DOCTOR;
	}

	public Long getSignId() {
		return signId;
	}

	public void setSignId(Long signId) {
		this.signId = signId;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getPhoneNo() {
		return phoneNo;
	}

	public void setPhoneNo(String phoneNo) {
		this.phoneNo = phoneNo;
	}

	@JsonIgnore
	public String getUserPwd() {
		return userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getQrCode() {
		return qrCode;
	}

	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}

	public String getContactAddr() {
		return contactAddr;
	}

	public void setContactAddr(String contactAddr) {
		this.contactAddr = contactAddr;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUserTypeName() {
		return userTypeName;
	}

	public void setUserTypeName(String userTypeName) {
		this.userTypeName = userTypeName;
	}

	public String getUserState() {
		return userState;
	}

	public void setUserState(String userState) {
		this.userState = userState;
	}

	public String getCertState() {
		return certState;
	}

	public void setCertState(String certState) {
		this.certState = certState;
	}

	public String getHeadUrl() {
		return headUrl;
	}

	public void setHeadUrl(String headUrl) {
		this.headUrl = headUrl;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLoginDevice() {
		return loginDevice;
	}

	public void setLoginDevice(String loginDevice) {
		this.loginDevice = loginDevice;
	}

	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	@Override
	@JsonIgnore
	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public Long getCreater() {
		return creater;
	}

	public void setCreater(Long creater) {
		this.creater = creater;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Long getModifier() {
		return modifier;
	}

	public void setModifier(Long modifier) {
		this.modifier = modifier;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Integer getDoctId() {
		return doctId;
	}

	public void setDoctId(Integer doctId) {
		this.doctId = doctId;
	}

	public String getDoctCategory() {
		return doctCategory;
	}

	public void setDoctCategory(String doctCategory) {
		this.doctCategory = doctCategory;
	}

	public String getDoctCode() {
		return doctCode;
	}

	public void setDoctCode(String doctCode) {
		this.doctCode = doctCode;
	}

	public String getJobTitle() {
		return jobTitle;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}

	public String getQualificationStatus() {
		return qualificationStatus;
	}

	public void setQualificationStatus(String qualificationStatus) {
		this.qualificationStatus = qualificationStatus;
	}

	public Date getQualificationTime() {
		return qualificationTime;
	}

	public void setQualificationTime(Date qualificationTime) {
		this.qualificationTime = qualificationTime;
	}

	public String getEduBack() {
		return eduBack;
	}

	public void setEduBack(String eduBack) {
		this.eduBack = eduBack;
	}

	public String getAchiAward() {
		return achiAward;
	}

	public void setAchiAward(String achiAward) {
		this.achiAward = achiAward;
	}

	public String getDoctMessage() {
		return doctMessage;
	}

	public void setDoctMessage(String doctMessage) {
		this.doctMessage = doctMessage;
	}

	public String getHospitalCode() {
		return hospitalCode;
	}

	public void setHospitalCode(String hospitalCode) {
		this.hospitalCode = hospitalCode;
	}

	public Date getWorkTime() {
		return workTime;
	}

	public void setWorkTime(Date workTime) {
		this.workTime = workTime;
	}

	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	public String getDoctType() {
		return doctType;
	}

	public void setDoctType(String doctType) {
		this.doctType = doctType;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getDeptCodeHos() {
		return deptCodeHos;
	}

	public void setDeptCodeHos(String deptCodeHos) {
		this.deptCodeHos = deptCodeHos;
	}

	public String getDeptNameHos() {
		return deptNameHos;
	}

	public void setDeptNameHos(String deptNameHos) {
		this.deptNameHos = deptNameHos;
	}

	public String getAccid() {
		return accid;
	}

	public void setAccid(String accid) {
		this.accid = accid;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getHosCode() {
		return hosCode;
	}

	public void setHosCode(String hosCode) {
		this.hosCode = hosCode;
	}

	public String getHosName() {
		return hosName;
	}

	public void setHosName(String hosName) {
		this.hosName = hosName;
	}

	public String getHosLevel() {
		return hosLevel;
	}

	public void setHosLevel(String hosLevel) {
		this.hosLevel = hosLevel;
	}

	public String getProv() {
		return prov;
	}

	public void setProv(String prov) {
		this.prov = prov;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getHosLongitude() {
		return hosLongitude;
	}

	public void setHosLongitude(String hosLongitude) {
		this.hosLongitude = hosLongitude;
	}

	public String getHosLatitude() {
		return hosLatitude;
	}

	public void setHosLatitude(String hosLatitude) {
		this.hosLatitude = hosLatitude;
	}

	public String getDeptType() {
		return deptType;
	}

	public void setDeptType(String deptType) {
		this.deptType = deptType;
	}

	public void setAppKey(String appKey) {
		this.appKey = appKey;
	}

	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}

	@Override
	public LoginMethodEnum getLoginMethod() {
		return loginMethod;
	}

	public void setLoginMethod(LoginMethodEnum loginMethod) {
		this.loginMethod = loginMethod;
	}
}
